#include<bits/stdc++.h>
#define int long long
#define rep(i,a,b) for(int i(a);i<=(b);++i)
#define req(i,a,b) for(int i(a);i>=(b);--i)
#define sort stable_sort
using namespace std;
char buf[1<<23],*p1=buf,*p2=buf,ubuf[1<<23],*u=ubuf;
#define getchar() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<21,stdin),p1==p2)?EOF:*p1++)
template<typename TP> inline TP read(TP &num)
{
	TP x=0;
	int f=0;
	char ch=getchar();
	while(ch<48||ch>57) f|=ch=='-',ch=getchar();
	while(48<=ch&&ch<=57) x=(x<<1)+(x<<3)+(ch^48),ch=getchar();
	return num=f?-x:x;
}
template<typename ...Args> inline void read(Args &...args)
{
	(read(args),...);
}
template<typename TP> inline void write(TP x)
{
	(x<0)?(putchar('-'),x=-x):0;
	(x>9)?(write(x/10),0):0;
	putchar((x%10)^48);
}
template<typename TP> inline void writeln(TP x)
{
	write<TP>(x);
	puts("");
}
int n,a[200001],b[200001],ans[200001];
int st_a[200001][21],st_b[200001][21],_lg2[200001];
inline void gen_st_a()
{
	rep(j,1,_lg2[n]) rep(i,1,n-(1<<j)+1) st_a[i][j]=min(st_a[i][j-1],st_a[i+(1<<(j-1))][j-1]);
}
inline void gen_st_b()
{
	rep(j,1,_lg2[n]) rep(i,1,n-(1<<j)+1) st_b[i][j]=min(st_b[i][j-1],st_b[i+(1<<(j-1))][j-1]);
}
inline int query_a(int l,int r)
{
	int k=_lg2[r-l+1];
	return min(st_a[l][k],st_a[r-(1<<k)+1][k]);
}
inline int query_b(int l,int r)
{
	int k=_lg2[r-l+1];
	return min(st_b[l][k],st_b[r-(1<<k)+1][k]);
}
inline void force()
{
	rep(i,2,n) _lg2[i]=_lg2[i>>1]+1;
	rep(i,1,n) read(a[i]),st_a[i][0]=a[i],ans[i]=0x7fffffff;
	rep(i,1,n) read(b[i]),st_b[i][0]=b[i];
	gen_st_a(),gen_st_b();
	rep(i,1,n) rep(j,i,n) ans[j-i+1]=min(ans[j-i+1],abs(query_a(i,j)-query_b(i,j)));
	rep(i,1,n) writeln(ans[i]);
}
signed main()
{
#ifndef ONLINE_JUDGE
	freopen("min.in","r",stdin);
	freopen("min.out","w",stdout);
#endif
	read(n);
	if(n<=1000) force(),exit(0);
	rep(i,1,n) read(a[i]);
	rep(i,1,n) read(b[i]);
	if(accumulate(b+1,b+n+1,0ll)==n)
	{
		int p=*min_element(a+1,a+n+1)-1;
		rep(i,1,n) writeln(p);
		exit(0);
	}
	if(accumulate(b+1,b+n+1,0ll)==n*1000000000)
	{
		// TODO property B
	}
	return 0;
}
